@extends('wap.layouts.master')
@section('title','个人信息')

@section('content')

<div class="aw-main aw-user aw-user-info" id="Form-team_edit">
	<!--表单-开始-->
	<ul class="aw-assest-form aw-bg-fff aw-mt15">
		<li class="aw-form-li aw-user-info-img">
			<div class="aw-left">头像</div>
			<div class="aw-conter aw-pr20">
				<img :src="info.img ? info.img : '/wap/img/login_img.png'" onerror="javascript:this.src='/wap/img/login_img.png';">
				<input type="file" name="upfile" id="file_img" v-on:click="Click_UpImg('img')">
				<input type="text" id="img" v-model="info.img" :value="info.img" class="aw-hide" placeholder="请上传队徽">
			</div>
			<div class="aw-icon aw-icon-more aw-right"></div>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">昵称</div>
			<div class="aw-conter aw-text-right">@{{info.nickname}}</div>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">手机号</div>
			<div class="aw-conter aw-text-right aw-pr20">@{{info.phone}}</div>
			<div class="aw-icon aw-icon-more aw-right"></div>
			<a href="/wap/user/phone" class="aw-position_a_a"></a>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">生日</div>
			<div class="aw-conter aw-text-right">@{{info.birthday}}</div>
		</li>
		<li class="aw-form-li">
			<div class="aw-left">年龄</div>
			<div class="aw-conter aw-text-right">@{{info.age}}</div>
		</li>
		<li class="aw-form-li aw-pl10">
			<div class="aw-left">所属球队</div>
			<ul class="aw-info-team-list">
				<li class="aw-info-team-list-li" v-for="(list,key) in list_team">
					<div :style="W_Style()"><img :src="list.img ? list.img : '/img/default_160_160.png'" onerror="javascript:this.src='/img/default_160_160.png';"></div>
					<p>@{{list.name}}</p>
					<a :href="'/wap/team/info?team_id='+list.id" class="aw-position_a_a"></a>
				</li>
			</ul>
		</li>
	</ul>
	<!--表单-结束-->
</div>
<div class="aw-bg-fff aw-foot-btn aw-foot-btn2">
	<a href="/wap/user/edit" class="aw-assest-btn aw-btn-bgcolor-lvse">修改资料</a>
</div>

@section('pagejs')
@parent

<!--图片上传-->
<script type="text/javascript" src="/library/jquery-file-upload/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/library/jquery-file-upload/js/jquery.fileupload.js"></script>
<script type="text/javascript">
var MJS_User_Info=GBC_User_Info;
var Vue_Data={
	info:{},
	list_team:{},
}
//用户详情
var AD_user_info={
	api:'/api/user/user-info',
	form_data:{},
	tips:false,
}
getData(AD_user_info,function(ajax_data_info){
	Vue_Data.info=ajax_data_info;
	Vue_Data.list_team=ajax_data_info.team_list.list;
	Post_Browser_Cache('user_info',ajax_data_info)
})
vm=new Vue({
	el:'#Vue-body',
	data:Vue_Data,
	methods:{
		Click_UpImg:function(name){
			Img_Upload(name,function(This,name,url){
				vm.info.img=url;
				var AD_img={
					api:'/api/user/user-save',
					form_data:vm.info,
					tips:'头像上传成功',
				}
				postData(AD_img,function(ajax_data){
					$.extend(MJS_User_Info,vm.info);
					Post_Browser_Cache('user_info',MJS_User_Info)
				})
			})
		},W_Style:function(){
			var Body_Width=$('body').width()
			Width=(Body_Width-40)/4-20;
			return 'height:'+Width+'px';
		}
	}
})
</script>
@endsection

@endsection

